home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / LCALTIME.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  463 b   |  15 lines

  1. /* localtime.c        Turbo C Bible Functions, p. 335     */
  2. #include <stdio.h>
  3. #include <time.h>
  4. main()
  5. {
  6.     time_t tnow;
  7.     struct tm *tmnow;
  8.     time(&tnow);/* Get the time in seconds since 0 hrs GMT, 1/1/70
  9.          * Convert it to string showing local time.  Use the
  10.          * environment variable TZ and the function "tzset"
  11.          * to set tieh timezone appropriately.
  12.          * Default time is PST. */
  13.     tmnow = localtime(&tnow);
  14.     printf("Local Time = %s\n", asctime(tmnow));
  15. }